#include <assert.h>
#include <iostream>
#include <time.h>

#include "night/array.hpp"
#include "night/tensor.hpp"

using namespace night;
using namespace night::array;

int main () 
{
	const int n = 3;
	const int m = 4;
	int x[n][m] = { {1,2,3,4}, {2,3,4,5}, {3,4,5,6} };
	int y[n][m];
	int * z = y[0];

	assert ( c_array (x) == c_array (x) );

// array_view test
	c_array (y) = c_array (x);
	assert ( c_array (y) == c_array (x) );

// pointer_view test
	assert (( c_array<n,m> (z) == c_array (x) ));

// bind_view test
	c_array (y) = c_array (x);
	c_array (y) [1] = c_array (x) (_i,_j) [1];
	assert ( c_array (y) == c_array (x) );

// slice_view test
	c_array (y) (_j,_i) = c_array (x) (_j,_i);
	assert ( c_array (x) == c_array (y) );

	c_array (y) (_i,1) = c_array (x) (_i,1);
	assert ( c_array (x) == c_array (y) );

	c_array (y) (1,_j) = c_array (x) (1,_j);
	assert ( c_array (x) == c_array (y) );

// operator << test
	std::cout << c_array (y).reshape<m,n> () << std::endl;

}
